from django.db import models

class Course(models.Model):
    name = models.CharField(max_length=255, verbose_name="课程名字", db_index=True)
    text = models.TextField(default="暂无")
    ontime = models.TimeField(verbose_name="上课时间")
    outtime = models.TimeField(verbose_name="下课时间")
    durattion = models.DurationField(verbose_name='课时')
    price = models.DecimalField(max_digits=8, decimal_places=2, verbose_name="价格")

    class Meta:
        db_table = "course"

    def __str__(self):
        return self.name

# class Course (models.Model):
#     name = models.CharField(max_length=255)
#     text = models.TextField(default="暂无")
#     ontime = models.TimeField()
#     outtime = models.TimeField()
#     durattion = models.DurationField()
#     price = models.DecimalField(max_digits=8, decimal_places=2)
#
#     class Meta:
#         db_table = "course"